#!/bin/sh

TMUX="/usr/bin/tmux"

$TMUX has-session -t default

if [ $? = 1 ]; then
# echo "$TMUX new-session -s default"
$TMUX new-session -s default
else
# echo "$TMUX attach-session -d -t default"
$TMUX attach-session -d -t default
fi





# new bastion session
# tmux new -s bastion -d
# rename window
## --- DEV ---
# tmux rename-window -t "bastion:1" dev
# # send command
# tmux send -t "bastion:dev" '/Users/nickchen/workspace/bastion.sh java-run "cd /home/nickchen/java-app/"' Enter
# # split window horizontally
# tmux split-window -t "bastion:dev"
# tmux send -t "bastion:dev" '/Users/nickchen/workspace/bastion.sh inner-01 "cd /opt"' Enter
# # split window vertically
# tmux split-window -h -t "bastion:dev"
# tmux send -t "bastion:dev" '/Users/nickchen/workspace/bastion.sh inner-02 "cd /opt"' Enter